import http from '../utils/request.js'

// 发布游记userId
// body category 分类  picture 图片 postContent 帖子内容 userId 用户id
export const sendtravel = (params) => {
	return http.post('/app/post/addPost', params)
}

// 删除游记
// query postId 游记id
export const deletetravel = (params) => {
	return http.delete(`/app/post/deletePost?postId=${params}`)
}

// 查询用户游记
// query userId 用户id pageNum 页码数   pageSize 页码数据大小
export const gettravel = (params) => {
	return http.get('/app/post/findByUserId', { params})
}

// 分类获取游记
// query  category 类别 pageNum 页码数   pageSize 页码数据大小
export const getcategorytravel = (params) => {
	return http.get('/app/post/getPost', { params })
}

// 搜索游记
// query  content 搜索关键字 pageNum 页码数   pageSize 页码数据大小
export const searchtravel = (params) => {
	return http.get('/app/post/searchPost', {params})
}

// 游记详情
// query  postId 帖子id
export const gettraveldet = (params) => {
	return http.get('/app/post/findPostByPostId', { params})
}

// 修改游记的点赞
// query likes 点赞次数  postId 游记id
export const updatetravelspot = (params) => {
	return http.put(`/app/post/updateLikes?likes=${params.likes}&postId=${params.postId}`)
}

// 发布游记评论
// body discussConent 评论内容   postId 游记id  userId 用户id
export const sendtravelcomment = (params) => {
	return http.post('/app/discuss/addDiscuss', params)
}

// 图片上传
// 
export const upload = (params) => {
	return http.post('http://123.56.84.99:8086/app/scenic/picUpload')
}